package com.huawei.rbac.design.builder;

import com.huawei.rbac.design.absfactory.MailSender;
import com.huawei.rbac.design.absfactory.Sender;
import com.huawei.rbac.design.absfactory.SmsSender;

import java.util.ArrayList;
import java.util.List;

/**
 * 建造者模式
 * @author luohua
 */
public class Builder {


    private List<Sender> list = new ArrayList<Sender>();

    public void produceMailSender(int count) {
        for (int i = 0; i < count; i++) {
            list.add(new MailSender());
        }
    }


    public void produceSmsSender(int count) {
        for (int i = 0; i < count; i++) {
            list.add(new SmsSender());
        }
    }
}